#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N = 1e6 + 10;
string x;
int la, lc;
int a[N], b, c[N];

void sub(int c[], int a[], int b)
{
    ll t = 0;
    for(int i = la - 1; i >= 0; i--)
    {
        t = t * 10 + a[i];
        c[i] = t / b;
        t %= b;
    }

    while(lc > 1 && c[lc - 1] == 0) lc--;
}

int main()
{
    cin >> x >> b;

    la = x.size();
    for(int i = 0; i < la; i++) a[la - 1 - i] = x[i] - '0';

    lc = la;
    sub(c, a, b);

    for(int i = lc - 1; i >= 0; i--) cout << c[i];
    return 0;
}
